<?php 
	class Incoming extends CI_controller
	{
		public function index()
		{
			$this->load->view('template/template');
			$this->load->view('setting/RM-Incoming');
			$this->load->view('template/footer');
		}
		public function output()
		{
			$inputData = array(
								"form_id"=>"6",
								"type_of"=>$this->input->post("incoming2"),
								"brand"=>$this->input->post("incoming3"),
								"grade"=>$this->input->post("incoming5"),
								"modify_user"=>"10001",
								"status"=>"1"
								
				);
				$inputAllData=array();
			 	for($i=11;$i<=22;$i++)
				{
			 		$data= array();
			 		
			 		$data = array(
			 						"data_name"=> "incoming".$i,
			 						"value_start"=> $this->input->post("incoming".$i."_1"),
									"value_end"=>$this->input->post("incoming".$i."_2")
			 						
			 					);
			 		$inputAllData[]=$data;
			 	}
				echo $this->incoming_model->checkIncoming($inputAllData,$inputData);
			}	
		public function checkIncoming()
		{
			{
				$inputData = array(
								"form_id"=>"6",
								"type_of"=>$this->input->post("incoming2"),
								"brand"=>$this->input->post("incoming3"),
								"grade"=>$this->input->post("incoming5"),
								"modify_user"=>"10001",
								"status"=>"1"
								
				);
				$text = "";
			 	$inputAllData=array();
			 	for($i=11;$i<=22;$i++){
			 		$data= array();
			 		$data = array(
			 						"data_name"=> "incoming".$i,
			 						"data_value"=> $this->input->post("incoming".$i."_1"),
									
			 					);
			 		$inputAllData[]=$data;
			 	}
				
				echo $this->incoming_model->keyIncoming($inputData,$inputAllData);
			}
		}
		
	}
?>